package com.heima.method;

public class Demo5 {
    public static void main(String[] args) {
        int[] data = {22, 21, 33, 34, 54, 34, 37, 44, 55, 66, 77, 88, 99, 89, 98};
        printArray(data);
    }

    public static void printArray(int[] data) {
        System.out.print("[");
        for (int i = 0; i < data.length; i++) {
            if (i == data.length - 1) {
                System.out.println(data[i] + "]");
            } else {
                System.out.print(data[i] + ",");
            }
        }
    }

}
